package com.ruoyi.assets.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.assets.mapper.AssetsDepartmentMapper;
import com.ruoyi.assets.domain.AssetsDepartment;
import com.ruoyi.assets.service.IAssetsDepartmentService;

/**
 * 部门Service业务层处理
 * 
 * @author 孙帆科
 * @date 2025-03-05
 */
@Service
public class AssetsDepartmentServiceImpl implements IAssetsDepartmentService 
{
    @Autowired
    private AssetsDepartmentMapper assetsDepartmentMapper;

    /**
     * 查询部门
     * 
     * @param departmentId 部门主键
     * @return 部门
     */
    @Override
    public AssetsDepartment selectAssetsDepartmentByDepartmentId(Long departmentId)
    {
        return assetsDepartmentMapper.selectAssetsDepartmentByDepartmentId(departmentId);
    }

    /**
     * 查询部门列表
     * 
     * @param assetsDepartment 部门
     * @return 部门
     */
    @Override
    public List<AssetsDepartment> selectAssetsDepartmentList(AssetsDepartment assetsDepartment)
    {
        return assetsDepartmentMapper.selectAssetsDepartmentList(assetsDepartment);
    }

    /**
     * 新增部门
     * 
     * @param assetsDepartment 部门
     * @return 结果
     */
    @Override
    public int insertAssetsDepartment(AssetsDepartment assetsDepartment)
    {
        return assetsDepartmentMapper.insertAssetsDepartment(assetsDepartment);
    }

    /**
     * 修改部门
     * 
     * @param assetsDepartment 部门
     * @return 结果
     */
    @Override
    public int updateAssetsDepartment(AssetsDepartment assetsDepartment)
    {
        return assetsDepartmentMapper.updateAssetsDepartment(assetsDepartment);
    }

    /**
     * 批量删除部门
     * 
     * @param departmentIds 需要删除的部门主键
     * @return 结果
     */
    @Override
    public int deleteAssetsDepartmentByDepartmentIds(Long[] departmentIds)
    {
        return assetsDepartmentMapper.deleteAssetsDepartmentByDepartmentIds(departmentIds);
    }

    /**
     * 删除部门信息
     * 
     * @param departmentId 部门主键
     * @return 结果
     */
    @Override
    public int deleteAssetsDepartmentByDepartmentId(Long departmentId)
    {
        return assetsDepartmentMapper.deleteAssetsDepartmentByDepartmentId(departmentId);
    }
}
